package top.kwseeker.spring.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import top.kwseeker.spring.aop.config.AopConfig;
import top.kwseeker.spring.aop.bean.EmployeeDTO;
import top.kwseeker.spring.aop.service.EmployeeManager;

public class AopAnnotationMain {

	public static void main(String[] args) {
		//对应使用 applicationContext.xml
		//ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
		//对应使用AopConfig配置类
		ApplicationContext context = new AnnotationConfigApplicationContext(AopConfig.class);
		EmployeeManager manager = context.getBean(EmployeeManager.class);

		manager.getEmployeeById(1);
		manager.createEmployee(new EmployeeDTO());
	}
}
